﻿CREATE TABLE tPunch
    (
      punchId INT NOT NULL
                  IDENTITY(1, 1)
                  CONSTRAINT [pk_tPunch_id] PRIMARY KEY ,
     punchDate DATETIME2 NOT NULL
        CONSTRAINT [df_tPunch_date] DEFAULT GETUTCDATE() ,
      punchIn TIME NOT NULL
                   CONSTRAINT [df_tPunch_In] DEFAULT CONVERT(TIME, GETDATE()) ,
      punchOut TIME
        NULL
        CONSTRAINT [df_tPunch_Out] DEFAULT CONVERT(TIME, GETDATE()) ,
      userId INT
        NOT NULL
        CONSTRAINT [fk_tPunch_userId]
        FOREIGN KEY REFERENCES dbo.tUsers ( userId ) ,
      isManagerAccepted BIT NOT NULL
                            CONSTRAINT [df_tPunch_isManagerAccepted] DEFAULT 0 ,
      requestForApproval BIT
        NOT NULL
        CONSTRAINT [df_tPunch_RequestForApproval] DEFAULT 0,
		comments VARCHAR(500) NULL
    )